package com.zkrt.upms.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.zkrt.upms.service.ITokenService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/token")
public class TokenController {

    @Autowired
    private ITokenService tokenService;

    /**
     * 获取鉴权
     * @param identity
     * @return
     */
    @GetMapping("/get")
    public R get(@RequestHeader(required = false, value = "identity") String identity) {
        return tokenService.get(identity);
    }

}
